package STUDENT.TRANBANGTUNG.day_05_04_2016;

import java.util.Scanner;

public class chanle {
	public static void main(String[] args) {
		int so;
		int chan = 0;
		int le = 0;
		String so1;
		String chanle;
		System.out.println("nhap so ban can kiem tra!");
		Scanner scso = new Scanner(System.in);
		so1 = scso.next();
		if (so1.isEmpty()) {
			System.out.println("nhap so vao de kiem tra!");
		} else {
			so = Integer.parseInt(so1);
			System.out.println("nhap loai so can kiem tra 'chan' hoac 'le'?");
			Scanner scchanle = new Scanner(System.in);
			chanle = scchanle.next();
			if (chanle.isEmpty()) {
				System.out.println("nhap vao loai so!");
			} else {
				if (chanle.equals("chan")) {
					int count = 0;
					while (count <= so) {						
						if (count % 2 == 0) {
							chan++;
							System.out.println("so luong so chan la: " + count);
						}
						count++;
					}

				} else if (chanle.equals("le")) {
					int count = 0;
					while (count <= so) {						
						if (count % 2 != 0) {
							le++;
							System.out.println("so luong so le la: " + count);
						}
						count++;
					}
				}

			}
		}

	}
}
